import request from "@/utils/request";

// 获取客户列表
export function getCustomerListApi(query, data) {
  return request({
    url: "/system/customer/list",
    method: "post",
    params: query,
    data,
  });
}


// 获取客户下拉框列表
export function getCustomerAllListApi() {
  return request({
    url: "/system/customer/queryCustomerAllList",
    method: "get",
  });
}

// 获取省市区列表
export function getProvinceApi(pid) {
  return request({
    url: "/system/area/selectSysAreas",
    method: "get",
    params: { pid },
  });
}

// 获取用户列表
export function getUserListApi(deptId) {
  return request({
    url: "/system/user/selectUserIList",
    method: "get",
    params: { deptId },
  });
}

// 获取用户列表
export function getnewUserListApi(query) {
  return request({
    url: "/system/user/selectUserIList",
    method: "get",
    params: query,
  });
}

// 获取部门列表
export function getDeptListApi() {
  return request({
    url: "/system/dept/listAll",
    method: "get",
    // params: { deptId },
  });
}

// 获取变更接口部门列表
export function getnewDeptListApi(deptType) {
  return request({
    url: "/system/dept/selectDeptListByid",
    method: "get",
    params: { deptType },
  });
}

// 获取客户详情
export function getCustomerDetailApi(customerId) {
  return request({
    url: "/system/customer/getInfo/" + customerId,
    method: "get",
  });
}

// 新增客户
export function addCustomerApi(data) {
  return request({
    url: "/system/customer",
    method: "post",
    data,
  });
}

// 编辑客户
export function editCustomerApi(data) {
  return request({
    url: "/system/customer/edit",
    method: "post",
    data,
  });
}

// 删除文件
export function deleteCustomerApi(customerId) {
  return request({
    url: `/system/customer/del`,
    method: "get",
    params: { customerId },
  });
}

// 新增跟进信息
export function addFollowApi(data) {
  return request({
    url: "/system/customerFollow/add",
    method: "post",
    data,
  });
}

// 获取最后跟进信息
export function getEndFollowApi(customerId) {
  return request({
    url: `/system/customerFollow/getFollowLastTime`,
    method: "get",
    params: { customerId },
  });
}
